<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">              
    
    <ui:composition template="templatePadrao.xhtml">
        
            <ui:define name="top">       
                <ui:include src="menu.xhtml" />
            </ui:define>             
        
      <ui:define name="content">
          
       <h:form id="formMessages">
           <p:growl id="messages" widgetVar="messages" showDetail="true" life="5000" sticky="false" autoUpdate="true" />  
       </h:form>   
          
       <h:form id="principal" prependId="false">
       
           <p:fieldset legend="Administração Grade Horária">
               
               <p:panelGrid id="padrao" columns="6" styleClass="usuarioGrid">
                   
                   <p:selectOneMenu style="width: 200px;" label="Unidade" id="selectUnidade" value="#{AdminGradeController.selectedUnidades}"> 
                         <p:ajax event="change" update="selectTurma"/>
                            <f:selectItems value="#{AdminGradeController.carregarUnidade}" />                            
                     </p:selectOneMenu>                    
                   
                   <p:selectOneMenu style="width: 200px;" label="Turma" id="selectTurma" value="#{AdminGradeController.selectedTurma}"> 
                         <f:selectItems value="#{AdminGradeController.carregarTurma}" />                         
                     </p:selectOneMenu>                                         
                   
                     <p:outputLabel value="De :" />
                     <p:inputText size="11" maxlength="10" id="filtroDataIni" value="#{AdminGradeController.dataIni}" title="Informe a data inicial" onblur="validaDataIni(this)" onkeyup="mascaraData(this)"/>
                     <p:outputLabel value="Até :" />
                     <p:inputText size="11" maxlength="10" id="filtroDataFim" value="#{AdminGradeController.dataFim}" title="Informe a data final" onblur="validaDataFim(this)" onkeyup="mascaraData(this)" />
                        
                     <p:commandButton id="geraGrade" value="Gerar Grade" actionListener="#{AdminGradeController.geraGrade()}" onclick="blockPrincipal.show()" oncomplete="blockPrincipal.hide()"/>
                   
               </p:panelGrid>
               
           </p:fieldset>
           
              <p:blockUI widgetVar="blockPrincipal" block="principal" >                               
                    <p:graphicImage value="./../img/ajax-loader.gif"/>                  
              </p:blockUI>            
           
       </h:form>
          
        </ui:define>            
   
   </ui:composition>
        
</html>          